<template>
  <input type="text" v-model="str" placeholder="请将数据放在此处"/>
  <button type="button" @click="test">按钮测试</button>
</template>

<script>
import axios from "axios";
export default {
  name: "DataLu",
  data(){
    return{
      str:""
    }
  },methods:{
    test(){
      axios.post(`http://localhost:8080/getJson`,this.str,{
        headers: {
          'Content-Type': 'application/json; charset=UTF-8'
        }
      }).then((res)=>{
        alert(res.data)
      })
    }
  }
}
</script>

<style scoped>

</style>